/**
 * Created by abdulazizalonizi on 7/25/17.
 */


import java.util.Scanner ;
import java.io.*;
public class Task4 {
    public static void main (String [] args)
    {
        boolean flag = true;
        boolean flag2 = false;
        Scanner kb = new Scanner (System.in);
        System.out.println("enter a word to search for");
        String key = kb.next();

        String s = null;

        try {

            FileInputStream fis = new FileInputStream("input.txt");
            Scanner fi = new Scanner(fis);

            while(flag)
            {
                s = fi.next();
                if(s.equals(key))
                {
                    flag2 = true;
                    break;
                }

            }
        }
        catch(Exception me)
        {

                    flag = false ;
        }


       if(flag2)
           System.out.println("word found");
        else
           System.out.println("word not found");
    }
}
